package xkp.lesson.converter;

import org.springframework.format.Formatter;
import xkp.lesson.entity.Point;

import java.text.ParseException;
import java.util.Locale;

public class PointFormater implements Formatter<Point> {
    @Override
    public Point parse(String s, Locale locale) throws ParseException {
        String[] xy = s.split(",");
        Double x = Double.parseDouble(xy[0]);
        Double y = Double.parseDouble(xy[1]);
        return new Point(x,y);
    }

    @Override
    public String print(Point point, Locale locale) {
        return null;
    }
}
